#include <iostream>
#include "Game.h"

using namespace std;



/**
 * Prints the equipment of the Player and asks for the itemID
 * @see Player::printOnlySimpleEquipment()
 * @param void
 * @return int - return the itemID of the chosen item
 */
int Game::printEquipMenuItem()
{
	int choice = 0;

	m_player->printOnlySimpleEquipment();
	cout << "Which item do you wish to equip? " << endl;
	cout << "(enter the number in front of the item you have chosen)" << endl;
	cin >> choice;
	cout << endl;
	return choice;
}

/**
 * Prints the different placements
 * @param void
 * @return char - choice of the item location
 */
char Game::printEquipMenuPlace()
{
	char choice = 0;

	cout << "========================================" << endl;
	cout << "1. [B]ackpack" << endl;
	cout << "2. [R]ight Hand" << endl;
	cout << "3. [L]eft Hand" << endl;
	cout << "4. B[o]dy" << endl;
	cout << "========================================" << endl;
	cout << "Where do you want to equip the item? ";
	cin >> choice;
	cout << endl;
	return choice;
}


/**
 * Processes the information from the EquipMenu functions
 * @see printEquipMenuItem()
 * @see printEquipMenuPlace()
 * @param char choicePlace - where to put the item
 * @param int choiceItem - which itemID to process
 * @return void
 */
void Game::processEquipMenu(char choicePlace, int choiceItem)
{
	switch (choicePlace)
	{
	case '1':
	case 'b':
	case 'B':
		m_player->addInBackpack(choiceItem);
		break;
	case '2':
	case 'r':
	case 'R':
		m_player->equipRightHand(choiceItem);
		break;
	case '3':
	case 'l':
	case 'L':
		m_player->equipLeftHand(choiceItem);
		break;
	case '4':
	case 'o':
	case 'O':
		m_player->equipBody(choiceItem);
		break;
	default:
		break;
	}
}
